import * as puppeteer from 'puppeteer';
function sendKeys(page: puppeteer.Page, keys: string)
{
    for (let s of keys)
    {
        page.keyboard.down(s);
        page.keyboard.up(s);
    }
}

(async () =>
{
    const browser = await puppeteer.launch({ headless: false });
    const page = await browser.newPage();
    await page.goto('http://localhost:7777/');

    sendKeys(page, "box ");
    page.click("#Webgl", { button: "left" });
    await page.screenshot({ path: './bin/example.png' });
    browser.close();
})();